package com.lh.java.basic.grammer;

import com.sun.istack.internal.FinalArrayList;

public class TestFinal {

	/**
	 * 功能描述  
	 * @Author: lh  2013-3-21 上午11:25:20
	 */
	public static void main(String[] args) {
		Student sOne = new Student("lishi", 50);
		Student sTwo = new Student("wangwu", 60);
		System.out.println(sOne);
		System.out.println(sTwo);
//		sOne.name ="xiaohua";//这样会报错说name为final不能改变

	}

}
class Student{
	public final String name;
	public final int age;
	public Student(String name,int age){
		this.name = name;
		this.age = age;
	}
	public String getName() {
		return name;
	}

	public int getAge() {
		return age;
	}
	
//	public void setName(final String name) {
//		this.name = name;
//	}
	@Override
	public String toString() {		
		return this.name+this.age;
	}
	
	
	
}